﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using APP.HELPER;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using Common.Report;
    using HRM.CORE;
    using HRM.CORE.REPORT;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms; using Common;
    using System.Data;
    using Common;
    using Extra.ERP;

    public class xfmPayInsurance : XtraForm
    {
        private Bar bar1;
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private BarManager barManager1;
        private BarButtonItem bbiC66aHD;
        private BarButtonItem bbiC67aHD;
        private BarButtonItem bbiC68aHD;
        private BarButtonItem bbiC69aHD;
        private BarButtonItem bbiClose;
        private BarButtonItem bbiDelete;
        private BarButtonItem bbiPayInsurance;
        private BarSubItem bbiPrint;
        private BarButtonItem bbiPrintC66aHD;
        private BarButtonItem bbiPrintC67aHD;
        private BarButtonItem bbiPrintC68aHD;
        private BarButtonItem bbiPrintC69aHD;
        private BarButtonItem bbiReload;
        private BarButtonItem bbiSave;
        private IContainer components = null;
        private GroupControl gcControl;
        private PanelControl gcLeft;
        public DevExpress.Utils.ImageCollection imageCollection3;
        private int m_Month = 0;
        private Guid m_PayInsuranceTableListID = Guid.Empty;
        private int m_Type = 0;
        private int m_Year = 0;
        private RepositoryItemComboBox repositoryItemComboBox1;
        private RepositoryItemImageComboBox repositoryItemImageComboBox1;
        private HRM.CORE.xucC66aHD xucC66aHD;
        private HRM.CORE.xucC67aHD xucC67aHD;
        private HRM.CORE.xucC68aHD xucC68aHD;
        private HRM.CORE.xucC69aHD xucC69aHD;
        private xucPayInsurance xucPayInsurance1;
        private xucSelectEmployees xucSelect;

        public xfmPayInsurance()
        {
            this.InitializeComponent();
        }

        private void bbiClose_ItemClick(object sender, ItemClickEventArgs e)
        {
            base.Close();
        }

        private void bbiCreateInsurance_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.SetDown(e.Item.Name);
            this.CreateInsurance(e.Item.Name);
        }

        private void bbiDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            if ((this.m_Type == 0) || (this.m_Type == 1))
            {
                this.xucC66aHD.Delete();
            }
            else if (this.m_Type == 2)
            {
                this.xucC67aHD.Delete();
            }
            else if (this.m_Type == 3)
            {
                this.xucC68aHD.Delete();
            }
            else if (this.m_Type == 4)
            {
                this.xucC69aHD.Delete();
            }
        }

        private void bbiPayInsurance_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.SetDown("bbiPayInsurance");
            if (this.xucSelect != null)
            {
                this.gcLeft.Controls.Remove(this.xucSelect);
                this.xucSelect = null;
            }
        }

        private void bbiPrint_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                xfmReport report = new xfmReport("Hợp Đồng Lao Động");
                if (e.Item == this.bbiPrintC66aHD)
                {
                    rptC66aHD xtraReport = new rptC66aHD(this.m_PayInsuranceTableListID);
                    report.SetTitle("Danh s\x00e1ch lao động đề nghị hưởng chế độ ốm đau (C66a-HD)");
                    report.ShowPrintPreview(xtraReport);
                }
                else if (e.Item == this.bbiPrintC67aHD)
                {
                    rptC67aHD ahd2 = new rptC67aHD(this.m_PayInsuranceTableListID);
                    report.SetTitle("Danh s\x00e1ch lao động đề nghị hưởng chế độ thai sản (C67a-HD)");
                    report.ShowPrintPreview(ahd2);
                }
                else if (e.Item == this.bbiPrintC68aHD)
                {
                    rptC68aHD ahd3 = new rptC68aHD(this.m_PayInsuranceTableListID);
                    report.SetTitle("Danh s\x00e1ch lao động đề nghị hưởng trợ cấp nghỉ DSPHSK sau ốm đau (C68a-HD)");
                    report.ShowPrintPreview(ahd3);
                }
                else if (e.Item == this.bbiPrintC69aHD)
                {
                    rptC69aHD ahd4 = new rptC69aHD(this.m_PayInsuranceTableListID);
                    report.SetTitle("Danh s\x00e1ch lao động đề nghị hưởng trợ cấp nghỉ DSPHSK sau thai sản (C69a-HD)");
                    report.ShowPrintPreview(ahd4);
                }
            }
            catch
            {
            }
        }

        private void bbiReload_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.Reload();
        }

        private void bbiSave_ItemClick(object sender, ItemClickEventArgs e)
        {
            if ((this.m_Type == 0) || (this.m_Type == 1))
            {
                this.xucC66aHD.Update();
            }
            else if (this.m_Type == 2)
            {
                this.xucC67aHD.Update();
            }
            else if (this.m_Type == 3)
            {
                this.xucC68aHD.Update();
            }
            else if (this.m_Type == 4)
            {
                this.xucC69aHD.Update();
            }
        }

        private void CreateInsurance(string item)
        {
            xucSelectEmployees.SelectedEventHander hander = null;
            xucSelectEmployees.SelectedEventHander hander2 = null;
            xucSelectEmployees.SelectedEventHander hander3 = null;
            xucSelectEmployees.SelectedEventHander hander4 = null;
            xucSelectEmployees.SelectedEventHander hander5 = null;
            if (this.xucSelect == null)
            {
                this.xucSelect = new xucSelectEmployees();
                if (hander == null)
                {
                    hander = delegate (object s, DataTable d) {
                        this.SetDown("bbiPayInsurance");
                        this.gcLeft.Controls.Remove(this.xucSelect);
                        this.xucSelect = null;
                    };
                }
                this.xucSelect.Selected += hander;
                this.xucSelect.Dock = DockStyle.Fill;
                this.gcLeft.Controls.Add(this.xucSelect);
                this.xucSelect.BringToFront();
            }
            string str = item;
            if (str != null)
            {
                if (!(str == "bbiC66aHD"))
                {
                    if (str == "bbiC67aHD")
                    {
                        this.xucSelect.LoadData(3, 1);
                        this.xucSelect.SetTitle("Đề Nghị Hưởng Chế Độ Thai Sản", "Ph\x00e1t Sinh");
                        if (hander3 == null)
                        {
                            hander3 = delegate (object s, DataTable dt) {
                                xfmC67aHDAdd add = new xfmC67aHDAdd(dt);
                                add.Created += se => this.Reload();
                                add.ShowDialog();
                            };
                        }
                        this.xucSelect.Selected += hander3;
                    }
                    else if (str == "bbiC68aHD")
                    {
                        this.xucSelect.LoadData(0, 1);
                        this.xucSelect.SetTitle("Đề Nghị Hưởng Trợ Cấp DSPHSK Sau Ốm Đau", "Ph\x00e1t Sinh");
                        if (hander4 == null)
                        {
                            hander4 = delegate (object s, DataTable dt) {
                                xfmC68aHDAdd add = new xfmC68aHDAdd(dt);
                                add.Created += se => this.Reload();
                                add.ShowDialog();
                            };
                        }
                        this.xucSelect.Selected += hander4;
                    }
                    else if (str == "bbiC69aHD")
                    {
                        this.xucSelect.LoadData(3, 1);
                        this.xucSelect.SetTitle("Đề Nghị Hưởng Trợ Cấp DSPHSK Sau Thai Sản", "Ph\x00e1t Sinh");
                        if (hander5 == null)
                        {
                            hander5 = delegate (object s, DataTable dt) {
                                xfmC69aHDAdd add = new xfmC69aHDAdd(dt);
                                add.Created += se => this.Reload();
                                add.ShowDialog();
                            };
                        }
                        this.xucSelect.Selected += hander5;
                    }
                }
                else
                {
                    this.xucSelect.LoadData(0, 1);
                    this.xucSelect.SetTitle("Đề Nghị Hưởng Chế Độ Ốm Đau", "Ph\x00e1t Sinh");
                    if (hander2 == null)
                    {
                        hander2 = delegate (object s, DataTable dt) {
                            xfmC66aHDAdd add = new xfmC66aHDAdd(dt);
                            add.Created += se => this.Reload();
                            add.ShowDialog();
                        };
                    }
                    this.xucSelect.Selected += hander2;
                }
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Execute(string id, string @ref)
        {
            string str = id;
            if (str != null)
            {
                if (!(str == "xucC66aHD"))
                {
                    if (str == "xucC67aHD")
                    {
                        SYS_LOG.Insert("Danh s\x00e1ch lao động tăng (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")", "Xem");
                        this.gcControl.Text = "Danh s\x00e1ch lao động tăng (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")";
                        if (this.xucC67aHD == null)
                        {
                            this.xucC67aHD = new HRM.CORE.xucC67aHD(this.m_PayInsuranceTableListID);
                            this.xucC67aHD.Dock = DockStyle.Fill;
                            this.gcControl.Controls.Add(this.xucC67aHD);
                            this.xucC67aHD.BringToFront();
                        }
                        else
                        {
                            this.xucC67aHD.LoadData(this.m_PayInsuranceTableListID);
                            this.xucC67aHD.BringToFront();
                        }
                    }
                    else if (str == "xucC68aHD")
                    {
                        SYS_LOG.Insert("Danh s\x00e1ch lao động giảm (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")", "Xem");
                        this.gcControl.Text = "Danh s\x00e1ch lao động giảm (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")";
                        if (this.xucC68aHD == null)
                        {
                            this.xucC68aHD = new HRM.CORE.xucC68aHD(this.m_PayInsuranceTableListID);
                            this.xucC68aHD.Dock = DockStyle.Fill;
                            this.gcControl.Controls.Add(this.xucC68aHD);
                            this.xucC68aHD.BringToFront();
                        }
                        else
                        {
                            this.xucC68aHD.LoadData(this.m_PayInsuranceTableListID);
                            this.xucC68aHD.BringToFront();
                        }
                    }
                    else if (str == "xucC69aHD")
                    {
                        SYS_LOG.Insert("Danh s\x00e1ch đề nghị điều chỉnh hồ sơ tham gia BHXH, BHYT (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")", "Xem");
                        this.gcControl.Text = "Danh s\x00e1ch đề nghị điều chỉnh hồ sơ tham gia BHXH, BHYT (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")";
                        if (this.xucC69aHD == null)
                        {
                            this.xucC69aHD = new HRM.CORE.xucC69aHD(this.m_PayInsuranceTableListID);
                            this.xucC69aHD.Dock = DockStyle.Fill;
                            this.gcControl.Controls.Add(this.xucC69aHD);
                            this.xucC69aHD.BringToFront();
                        }
                        else
                        {
                            this.xucC69aHD.LoadData(this.m_PayInsuranceTableListID);
                            this.xucC69aHD.BringToFront();
                        }
                    }
                }
                else
                {
                    SYS_LOG.Insert("Danh s\x00e1ch lao động ph\x00e1t sinh nghiệp vụ bảo hiểm (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")", "Xem");
                    this.gcControl.Text = "Danh s\x00e1ch lao động ph\x00e1t sinh nghiệp vụ bảo hiểm (th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString() + ")";
                    if (this.xucC66aHD == null)
                    {
                        this.xucC66aHD = new HRM.CORE.xucC66aHD(this.m_PayInsuranceTableListID);
                        this.xucC66aHD.Dock = DockStyle.Fill;
                        this.gcControl.Controls.Add(this.xucC66aHD);
                        this.xucC66aHD.BringToFront();
                    }
                    else
                    {
                        this.xucC66aHD.LoadData(this.m_PayInsuranceTableListID);
                        this.xucC66aHD.BringToFront();
                    }
                }
            }
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xfmPayInsurance));
            MenuButton button = new MenuButton();
            ItemCommand command = new ItemCommand();
            ItemCommand command2 = new ItemCommand();
            ItemCommand command3 = new ItemCommand();
            ItemCommand command4 = new ItemCommand();
            ItemCommand command5 = new ItemCommand();
            ItemCommand command6 = new ItemCommand();
            ItemCommand command7 = new ItemCommand();
            ItemCommand command8 = new ItemCommand();
            ItemCommand command9 = new ItemCommand();
            ItemCommand command10 = new ItemCommand();
            ItemCommand command11 = new ItemCommand();
            ItemCommand command12 = new ItemCommand();
            ItemCommand command13 = new ItemCommand();
            ItemCommand command14 = new ItemCommand();
            ItemCommand command15 = new ItemCommand();
            ItemCommand command16 = new ItemCommand();
            ItemCommand command17 = new ItemCommand();
            ItemCommand command18 = new ItemCommand();
            ItemCommand command19 = new ItemCommand();
            ItemCommand command20 = new ItemCommand();
            ItemCommand command21 = new ItemCommand();
            ItemCommand command22 = new ItemCommand();
            ItemCommand command23 = new ItemCommand();
            ItemCommand command24 = new ItemCommand();
            ItemCommand command25 = new ItemCommand();
            ItemCommand command26 = new ItemCommand();
            ItemCommand command27 = new ItemCommand();
            ItemCommand command28 = new ItemCommand();
            ItemCommand command29 = new ItemCommand();
            this.imageCollection3 = new DevExpress.Utils.ImageCollection(this.components);
            this.gcLeft = new PanelControl();
            this.xucPayInsurance1 = new xucPayInsurance();
            this.barManager1 = new BarManager(this.components);
            this.bar1 = new Bar();
            this.bbiSave = new BarButtonItem();
            this.bbiPrint = new BarSubItem();
            this.bbiPrintC66aHD = new BarButtonItem();
            this.bbiPrintC67aHD = new BarButtonItem();
            this.bbiPrintC68aHD = new BarButtonItem();
            this.bbiPrintC69aHD = new BarButtonItem();
            this.bbiPayInsurance = new BarButtonItem();
            this.bbiC66aHD = new BarButtonItem();
            this.bbiC67aHD = new BarButtonItem();
            this.bbiC68aHD = new BarButtonItem();
            this.bbiC69aHD = new BarButtonItem();
            this.bbiDelete = new BarButtonItem();
            this.bbiReload = new BarButtonItem();
            this.bbiClose = new BarButtonItem();
            this.barDockControlTop = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft = new BarDockControl();
            this.barDockControlRight = new BarDockControl();
            this.repositoryItemComboBox1 = new RepositoryItemComboBox();
            this.repositoryItemImageComboBox1 = new RepositoryItemImageComboBox();
            this.gcControl = new GroupControl();
            this.imageCollection3.BeginInit();
            this.gcLeft.BeginInit();
            this.gcLeft.SuspendLayout();
            this.barManager1.BeginInit();
            this.repositoryItemComboBox1.BeginInit();
            this.repositoryItemImageComboBox1.BeginInit();
            this.gcControl.BeginInit();
            base.SuspendLayout();
            this.imageCollection3.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection3.ImageStream");
            this.imageCollection3.Images.SetKeyName(3, "reload16x16.png");
            this.imageCollection3.Images.SetKeyName(4, "delete.png");
            this.imageCollection3.Images.SetKeyName(5, "edit.png");
            this.imageCollection3.Images.SetKeyName(6, "hp_folder_boy.png");
            this.imageCollection3.Images.SetKeyName(7, "hp_folder_girl.png");
            this.imageCollection3.Images.SetKeyName(8, "user_red_edit.png");
            this.imageCollection3.Images.SetKeyName(9, "users_edit.png");
            this.imageCollection3.Images.SetKeyName(10, "user_female_go.png");
            this.imageCollection3.Images.SetKeyName(11, "direction_up.png");
            this.imageCollection3.Images.SetKeyName(12, "66a.png");
            this.imageCollection3.Images.SetKeyName(13, "67a.png");
            this.imageCollection3.Images.SetKeyName(14, "68a.png");
            this.imageCollection3.Images.SetKeyName(15, "69a.png");
            this.gcLeft.BorderStyle = BorderStyles.NoBorder;
            this.gcLeft.Controls.Add(this.xucPayInsurance1);
            this.gcLeft.Dock = DockStyle.Left;
            this.gcLeft.Location = new Point(0, 0x1a);
            this.gcLeft.Name = "gcLeft";
            this.gcLeft.Padding = new Padding(2);
            this.gcLeft.Size = new Size(0xda, 0x25e);
            this.gcLeft.TabIndex = 2;
            this.xucPayInsurance1.Dock = DockStyle.Fill;
            this.xucPayInsurance1.IsClose = CloseOrNew.None;
            this.xucPayInsurance1.Location = new Point(2, 2);
            this.xucPayInsurance1.Name = "xucPayInsurance1";
            this.xucPayInsurance1.NotSave = false;
            command.Caption = "";
            command.Enable = false;
            command.Visibility = BarItemVisibility.Never;
            button.Add = command;
            command2.Caption = "";
            command2.Enable = false;
            command2.Visibility = BarItemVisibility.Never;
            button.Cancel = command2;
            command3.Caption = "";
            command3.Enable = false;
            command3.Visibility = BarItemVisibility.Never;
            button.Change = command3;
            command4.Caption = "";
            command4.Enable = false;
            command4.Visibility = BarItemVisibility.Never;
            button.Close = command4;
            command5.Caption = "";
            command5.Enable = false;
            command5.Visibility = BarItemVisibility.Never;
            button.Custom = command5;
            command6.Caption = "";
            command6.Enable = false;
            command6.Visibility = BarItemVisibility.Never;
            button.Delete = command6;
            command7.Caption = "";
            command7.Enable = false;
            command7.Visibility = BarItemVisibility.Never;
            button.Export = command7;
            command8.Caption = "";
            command8.Enable = false;
            command8.Visibility = BarItemVisibility.Never;
            button.Filter = command8;
            command9.Caption = "";
            command9.Enable = false;
            command9.Visibility = BarItemVisibility.Never;
            button.FilterCustomer = command9;
            command10.Caption = "";
            command10.Enable = false;
            command10.Visibility = BarItemVisibility.Never;
            button.FilterStock = command10;
            command11.Caption = "";
            command11.Enable = false;
            command11.Visibility = BarItemVisibility.Never;
            button.Find = command11;
            button.GClose = false;
            button.GCommand = false;
            button.GExport = false;
            command12.Caption = "";
            command12.Enable = false;
            command12.Visibility = BarItemVisibility.Never;
            button.Go = command12;
            button.GOption = false;
            button.GPrint = false;
            button.GRecords = false;
            button.GSearchBar = false;
            button.GSettings = false;
            button.GVaildation = false;
            command13.Caption = "";
            command13.Enable = false;
            command13.Visibility = BarItemVisibility.Never;
            button.Import = command13;
            command14.Caption = "";
            command14.Enable = false;
            command14.Visibility = BarItemVisibility.Never;
            button.Next = command14;
            command15.Caption = "";
            command15.Enable = false;
            command15.Visibility = BarItemVisibility.Never;
            button.PageSetup = command15;
            button.PHome = false;
            command16.Caption = "";
            command16.Enable = false;
            command16.Visibility = BarItemVisibility.Never;
            button.Previous = command16;
            command17.Caption = "";
            command17.Enable = false;
            command17.Visibility = BarItemVisibility.Never;
            button.Print = command17;
            command18.Caption = "";
            command18.Enable = false;
            command18.Visibility = BarItemVisibility.Never;
            button.PrintPreview = command18;
            button.PTool = false;
            command19.Caption = "";
            command19.Enable = false;
            command19.Visibility = BarItemVisibility.Never;
            button.Redo = command19;
            command20.Caption = "";
            command20.Enable = false;
            command20.Visibility = BarItemVisibility.Never;
            button.Refresh = command20;
            command21.Caption = "";
            command21.Enable = false;
            command21.Visibility = BarItemVisibility.Never;
            button.Save = command21;
            command22.Caption = "";
            command22.Enable = false;
            command22.Visibility = BarItemVisibility.Never;
            button.SaveAndClose = command22;
            command23.Caption = "";
            command23.Enable = false;
            command23.Visibility = BarItemVisibility.Never;
            button.SaveAndNew = command23;
            command24.Caption = "";
            command24.Enable = false;
            command24.Visibility = BarItemVisibility.Never;
            button.Search = command24;
            command25.Caption = "";
            command25.Enable = false;
            command25.Visibility = BarItemVisibility.Never;
            button.SearchText = command25;
            command26.Caption = "";
            command26.Enable = false;
            command26.Visibility = BarItemVisibility.Never;
            button.Task = command26;
            command27.Caption = "";
            command27.Enable = false;
            command27.Visibility = BarItemVisibility.Never;
            button.Undo = command27;
            command28.Caption = "";
            command28.Enable = false;
            command28.Visibility = BarItemVisibility.Never;
            button.Vaildate = command28;
            command29.Caption = "";
            command29.Enable = false;
            command29.Visibility = BarItemVisibility.Never;
            button.View = command29;
            this.xucPayInsurance1.RibbonBar = button;
            this.xucPayInsurance1.Size = new Size(0xd6, 0x25a);
            this.xucPayInsurance1.Status = Actions.None;
            this.xucPayInsurance1.TabIndex = 0;
            this.xucPayInsurance1.Title = "";
            this.barManager1.Bars.AddRange(new Bar[] { this.bar1 });
            this.barManager1.DockControls.Add(this.barDockControlTop);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form = this;
            this.barManager1.Images = this.imageCollection3;
            this.barManager1.Items.AddRange(new BarItem[] { this.bbiSave, this.bbiClose, this.bbiC66aHD, this.bbiC67aHD, this.bbiC68aHD, this.bbiC69aHD, this.bbiPrint, this.bbiPrintC66aHD, this.bbiPrintC67aHD, this.bbiPrintC68aHD, this.bbiPrintC69aHD, this.bbiReload, this.bbiPayInsurance, this.bbiDelete });
            this.barManager1.MaxItemId = 30;
            this.barManager1.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemComboBox1, this.repositoryItemImageComboBox1 });
            this.bar1.BarName = "Custom 2";
            this.bar1.DockCol = 0;
            this.bar1.DockRow = 0;
            this.bar1.DockStyle = BarDockStyle.Top;
            this.bar1.FloatLocation = new Point(0x3e, 0xa8);
            this.bar1.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiSave, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiPrint, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiPayInsurance, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiC66aHD, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiC67aHD, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiC68aHD, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiC69aHD, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiDelete, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiReload, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiClose, BarItemPaintStyle.CaptionGlyph) });
            this.bar1.OptionsBar.UseWholeRow = true;
            this.bar1.Text = "Custom 2";
            this.bbiSave.Caption = "Lưu";
            this.bbiSave.Id = 0;
            this.bbiSave.ImageIndex = 1;
            this.bbiSave.Name = "bbiSave";
            this.bbiSave.ItemClick += new ItemClickEventHandler(this.bbiSave_ItemClick);
            this.bbiPrint.Caption = "In";
            this.bbiPrint.Id = 20;
            this.bbiPrint.ImageIndex = 0;
            this.bbiPrint.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.bbiPrintC66aHD), new LinkPersistInfo(this.bbiPrintC67aHD), new LinkPersistInfo(this.bbiPrintC68aHD), new LinkPersistInfo(this.bbiPrintC69aHD) });
            this.bbiPrint.Name = "bbiPrint";
            this.bbiPrintC66aHD.Caption = "Mẫu số C66a-HD: Danh s\x00e1ch người lao động đề nghị hưởng chế độ ốm đau";
            this.bbiPrintC66aHD.Id = 0x15;
            this.bbiPrintC66aHD.ImageIndex = 12;
            this.bbiPrintC66aHD.Name = "bbiPrintC66aHD";
            this.bbiPrintC66aHD.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiPrintC67aHD.Caption = "Mẫu số C67a-HD: Danh s\x00e1ch người lao động đề nghị hưởng chế độ thai sản";
            this.bbiPrintC67aHD.Id = 0x16;
            this.bbiPrintC67aHD.ImageIndex = 13;
            this.bbiPrintC67aHD.Name = "bbiPrintC67aHD";
            this.bbiPrintC67aHD.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiPrintC68aHD.Caption = "Mẫu số C68a-HD: Danh s\x00e1ch người lao động đề nghị hưởng trợ cấp nghỉ DSPHSK sau ốm đau";
            this.bbiPrintC68aHD.Id = 0x17;
            this.bbiPrintC68aHD.ImageIndex = 14;
            this.bbiPrintC68aHD.Name = "bbiPrintC68aHD";
            this.bbiPrintC68aHD.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiPrintC69aHD.Caption = "Mẫu số 69a-HD: Danh s\x00e1ch người lao động đề nghị hưởng trợ cấp nghỉ DSPHSK sau thai sản";
            this.bbiPrintC69aHD.Id = 0x19;
            this.bbiPrintC69aHD.ImageIndex = 15;
            this.bbiPrintC69aHD.Name = "bbiPrintC69aHD";
            this.bbiPrintC69aHD.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiPayInsurance.ButtonStyle = BarButtonStyle.Check;
            this.bbiPayInsurance.Caption = "Đợt Thanh To\x00e1n";
            this.bbiPayInsurance.Down = true;
            this.bbiPayInsurance.Id = 0x1c;
            this.bbiPayInsurance.ImageIndex = 11;
            this.bbiPayInsurance.Name = "bbiPayInsurance";
            this.bbiPayInsurance.ItemClick += new ItemClickEventHandler(this.bbiPayInsurance_ItemClick);
            this.bbiC66aHD.ButtonStyle = BarButtonStyle.Check;
            this.bbiC66aHD.Caption = "Đề Nghị Hưởng Ốm Đau";
            this.bbiC66aHD.Id = 9;
            this.bbiC66aHD.ImageIndex = 8;
            this.bbiC66aHD.Name = "bbiC66aHD";
            this.bbiC66aHD.ItemClick += new ItemClickEventHandler(this.bbiCreateInsurance_ItemClick);
            this.bbiC67aHD.ButtonStyle = BarButtonStyle.Check;
            this.bbiC67aHD.Caption = "Đề Nghị Hưởng Thai Sản";
            this.bbiC67aHD.Id = 10;
            this.bbiC67aHD.ImageIndex = 6;
            this.bbiC67aHD.Name = "bbiC67aHD";
            this.bbiC67aHD.ItemClick += new ItemClickEventHandler(this.bbiCreateInsurance_ItemClick);
            this.bbiC68aHD.ButtonStyle = BarButtonStyle.Check;
            this.bbiC68aHD.Caption = "DSPHSK Sau Ốm Đau";
            this.bbiC68aHD.Id = 11;
            this.bbiC68aHD.ImageIndex = 9;
            this.bbiC68aHD.Name = "bbiC68aHD";
            this.bbiC68aHD.ItemClick += new ItemClickEventHandler(this.bbiCreateInsurance_ItemClick);
            this.bbiC69aHD.ButtonStyle = BarButtonStyle.Check;
            this.bbiC69aHD.Caption = "DSPHSK Sau Thai Sản";
            this.bbiC69aHD.Id = 12;
            this.bbiC69aHD.ImageIndex = 10;
            this.bbiC69aHD.Name = "bbiC69aHD";
            this.bbiC69aHD.ItemClick += new ItemClickEventHandler(this.bbiCreateInsurance_ItemClick);
            this.bbiDelete.Caption = "X\x00f3a";
            this.bbiDelete.Id = 0x1d;
            this.bbiDelete.ImageIndex = 4;
            this.bbiDelete.Name = "bbiDelete";
            this.bbiDelete.ItemClick += new ItemClickEventHandler(this.bbiDelete_ItemClick);
            this.bbiReload.Caption = "Nạp Lại";
            this.bbiReload.Id = 0x1b;
            this.bbiReload.ImageIndex = 3;
            this.bbiReload.Name = "bbiReload";
            this.bbiReload.ItemClick += new ItemClickEventHandler(this.bbiReload_ItemClick);
            this.bbiClose.Caption = "Đ\x00f3ng";
            this.bbiClose.Id = 2;
            this.bbiClose.ImageIndex = 2;
            this.bbiClose.Name = "bbiClose";
            this.bbiClose.ItemClick += new ItemClickEventHandler(this.bbiClose_ItemClick);
            this.repositoryItemComboBox1.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.repositoryItemComboBox1.Appearance.Options.UseFont = true;
            this.repositoryItemComboBox1.AppearanceDropDown.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.repositoryItemComboBox1.AppearanceDropDown.Options.UseFont = true;
            this.repositoryItemComboBox1.AutoHeight = false;
            this.repositoryItemComboBox1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemComboBox1.Items.AddRange(new object[] { "Đang tham gia BHXH", "Chưa tham gia BHXH", "Ngưng tham gia BHXH" });
            this.repositoryItemComboBox1.Name = "repositoryItemComboBox1";
            this.repositoryItemImageComboBox1.AutoHeight = false;
            this.repositoryItemImageComboBox1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemImageComboBox1.Items.AddRange(new ImageComboBoxItem[] { new ImageComboBoxItem("<Hiển thị tất cả>", 0, -1), new ImageComboBoxItem("<Danh s\x00e1ch đang tham gia BHXH, BHYT>", 1, -1), new ImageComboBoxItem("<Danh s\x00e1ch chưa tham gia BHXH, BHYT>", 2, -1), new ImageComboBoxItem("<Danh s\x00e1ch tạm ngưng tham gia BHXH, BHYT>", 3, -1) });
            this.repositoryItemImageComboBox1.Name = "repositoryItemImageComboBox1";
            this.repositoryItemImageComboBox1.NullText = "<Chọn...>";
            this.gcControl.BorderStyle = BorderStyles.NoBorder;
            this.gcControl.Dock = DockStyle.Fill;
            this.gcControl.Location = new Point(0xda, 0x1a);
            this.gcControl.Name = "gcControl";
            this.gcControl.Size = new Size(0x386, 0x25e);
            this.gcControl.TabIndex = 4;
            this.gcControl.Text = "groupControl1";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x460, 0x278);
            base.Controls.Add(this.gcControl);
            base.Controls.Add(this.gcLeft);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Name = "xfmPayInsurance";
            this.Text = "C\x00e1c Đợt Thanh To\x00e1n BHXH, BHYT";
            base.Load += new EventHandler(this.xfmPayInsurance_Load);
            this.imageCollection3.EndInit();
            this.gcLeft.EndInit();
            this.gcLeft.ResumeLayout(false);
            this.barManager1.EndInit();
            this.repositoryItemComboBox1.EndInit();
            this.repositoryItemImageComboBox1.EndInit();
            this.gcControl.EndInit();
            base.ResumeLayout(false);
        }

        private void Reload()
        {
            if (this.m_Type == 0)
            {
                this.xucC66aHD.LoadData(this.m_PayInsuranceTableListID);
            }
            else if (this.m_Type == 1)
            {
                this.xucC66aHD.LoadData(this.m_PayInsuranceTableListID);
            }
            else if (this.m_Type == 2)
            {
                this.xucC67aHD.LoadData(this.m_PayInsuranceTableListID);
            }
            else if (this.m_Type == 3)
            {
                this.xucC68aHD.LoadData(this.m_PayInsuranceTableListID);
            }
            else if (this.m_Type == 4)
            {
                this.xucC69aHD.LoadData(this.m_PayInsuranceTableListID);
            }
        }

        private void SetDown(string item)
        {
            this.bbiPayInsurance.Down = false;
            this.bbiC66aHD.Down = false;
            this.bbiC67aHD.Down = false;
            this.bbiC68aHD.Down = false;
            this.bbiC69aHD.Down = false;
            string str = item;
            if (str != null)
            {
                if (!(str == "bbiPayInsurance"))
                {
                    if (str == "bbiC66aHD")
                    {
                        this.bbiC66aHD.Down = true;
                    }
                    else if (str == "bbiC67aHD")
                    {
                        this.bbiC67aHD.Down = true;
                    }
                    else if (str == "bbiC68aHD")
                    {
                        this.bbiC68aHD.Down = true;
                    }
                    else if (str == "bbiC69aHD")
                    {
                        this.bbiC69aHD.Down = true;
                    }
                }
                else
                {
                    this.bbiPayInsurance.Down = true;
                }
            }
        }

        private void xfmPayInsurance_Load(object sender, EventArgs e)
        {
            this.Execute("xucC66aHD", "");
            this.xucPayInsurance1.Selected += new xucPayInsurance.SelectedEventHander(this.xucPayInsurance1_Selected);
            this.xucPayInsurance1.LoadData();
        }

        private void xucPayInsurance1_Selected(object sender, PayInsurance Item)
        {
            this.m_PayInsuranceTableListID = Item.PayInsuranceTableListID;
            HRM_PAYINSURANCE_TABLELIST hrm_payinsurance_tablelist = new HRM_PAYINSURANCE_TABLELIST();
            hrm_payinsurance_tablelist.Get(this.m_PayInsuranceTableListID);
            this.m_Month = hrm_payinsurance_tablelist.Month;
            this.m_Year = hrm_payinsurance_tablelist.Year;
            if (Item.Type == 0)
            {
                this.m_Type = 0;
                this.Execute("xucC66aHD", "");
            }
            else if (Item.Type == 1)
            {
                this.m_Type = 1;
                this.Execute("xucC66aHD", "");
            }
            else if (Item.Type == 2)
            {
                this.m_Type = 2;
                this.Execute("xucC67aHD", "");
            }
            else if (Item.Type == 3)
            {
                this.m_Type = 3;
                this.Execute("xucC68aHD", "");
            }
            else if (Item.Type == 4)
            {
                this.m_Type = 4;
                this.Execute("xucC69aHD", "");
            }
        }
    }
}

